<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <%--地图--%>
    <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>景点详情</title>
    <link href="${pageContext.request.contextPath}/css/travel/scenic_detail.css" rel="stylesheet">
        <script src="${pageContext.request.contextPath}/dist/jquery-3.6.0.min.js"></script>
        <script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=hvAVFbUOTz9BKeqZpIltLjptQu5Q0GXH"></script>
        <style>
            body,html{
                width: 100%;
                height: 100%;
                padding: 0;
                margin: 0;
            }
            #container{
                width: 100%;
                height: 400px;
                overflow: hidden;
                margin-top: 20px;
            }
            #result{
                position: fixed;
                top: 10px;
                left: 10px;
                width: 250px;
                height: 30px;
                line-height: 30px;
                text-align: center;
                background: #fff;
                box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
                border-radius: 7px;
                z-index: 99;
            }
        </style>
</head>
<body>
<c:import url="/header/header.jsp"/>
<div class="top-rows">
    <div class="title">
        <h1>${response.data.travelSightsName}</h1>
        <div class="title-pinyin">ZI YOU XING</div>
    </div>
    <div class="top-nav">
        <ul>
            <li>
                <span>概况</span>
            </li>
        </ul>
    </div>
</div>

<div class="main">
    <a>
        <div class="main-pictures">
            <div class="null-div">
                <div class="picture">
                    <div class="pic-big">
                        <img src="" class="m1">
                    </div>
                    <div class="pic-small">
                        <img src="" class="m2">
                    </div>
                    <div class="pic-small">
                        <img src="" class="m3">
                    </div>
                </div>
            </div>
        </div>
    </a>
    <script>
        var str = '${response.data.travelSightsMainImg}';
        var strs = str.split(";");
        console.log(strs[0])
        $(".m1").attr("src",strs[0])
        $(".m2").attr("src",strs[1])
        $(".m3").attr("src",strs[2])
    </script>
<div class="text-detail">
    <div class="text">
        <h3 style="margin-bottom: 20px"> 介绍</h3>
        ${response.data. travelSightsDescribe}</div>
</div>
<div class="destination-connext">
    <ul>
        <li>门票:</li>
        <li>全价门票：<span>${response.data.travelTicketsPrice}</span> <span>元</span><br>
            半票：<span>${response.data.travelTicketsPrice/2}</span> <span>元</span><br>
        </li>
    </ul>
    <ul>
        <li>开放时间:</li>
        <li>
            08:00-17:30(营业时间),08:00-16:00(上岛时间),09:30-19:00(下岛时间) (1月1日-12月31日 周一-周日)<br>
            tips:<br>
            营业、下岛时间受海况、天气影响会有所变化，实际时间请以当天景区营业时间为准，敬请谅解、配合
        </li>
        <li>
            <div id='container'></div>
            <div id='result'>${response.data.travelSightsName}</div>

        </li>
    </ul>

</div>
</div>
<div class="fix-strip">
    <div class="fix-right">
        <ul>
            <li>
                <a href="" class="btn">立即定制</a>
            </li>
            <li>
                <a href="${pageContext.request.contextPath}/sights/sales/${response.data.travelSightsId}"  class="btn">立即购买</a>
            </li>
        </ul>

    </div>
</div>

<script>
    var map = new BMapGL.Map('container');
    map.centerAndZoom(new BMapGL.Point(116.331398,39.897445), 12);
    //创建地址解析器实例
    var myGeo = new BMapGL.Geocoder();
    // 将地址解析结果显示在地图上，并调整地图视野
    myGeo.getPoint('${response.data.travelSightsName}', function(point){
        if(point){
            map.centerAndZoom(point, 16);
            map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
            map.addOverlay(new BMapGL.Marker(point, {title: '${response.data.travelSightsName}'}))
        }else{
            alert('您选择的地址没有解析到结果！');
        }
    }, '${response.data.travelSightsLocProvince}')
</script>
</body>
</html>
